﻿// =================================================================================================
//   CComInitRAII class implementation.
//
// Copyright © InnovMetric Software Inc. 2014 All Rights Reserved
// -------------------------------------------------------------------------------------------------

// =================================================================================================
// ======================================== INCLUDED FILES =========================================

#include "CComInitRAII.h"

#include <combaseapi.h>

// =================================================================================================
// ========================================= NAMESPACES ============================================

// =================================================================================================
// =========================================== MACROS ==============================================

// =================================================================================================
// ====================================== CONSTANTS, ENUMS =========================================

// =================================================================================================
// ================================ TYPES, CLASSES, STRUCTURES =====================================

// =================================================================================================
// ================================== STATIC MEMBER VARIABLES ======================================

// =================================================================================================
// ===================================== GLOBAL VARIABLES ==========================================

// =================================================================================================
// ===================================== FUNCTION PROTOTYPES =======================================

// =================================================================================================
// ===================================== FUNCTION DEFINITIONS ======================================

// =================================================================================================
CComInitRAII::CComInitRAII()
{
    m_hr = CoInitializeEx( nullptr, COINIT_APARTMENTTHREADED );
}


// =================================================================================================
CComInitRAII::~CComInitRAII()
{
    if ( SUCCEEDED( m_hr ) )
    {
        CoUninitialize();
    }
}
